# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-integration
pkgver=6.0.4
pkgrel=0
pkgdesc="Qt Platform Theme integration plugins for the Plasma workspace"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="(LGPL-2.1-only OR LGPL-3.0-only) AND LGPL-2.1-only AND ((LGPL-2.1-only WITH Nokia-Qt-exception-1.1) OR (GPL-3.0-only WITH Nokia-Qt-exception-1.1))"
depends="
	font-hack
	font-noto
	qqc2-breeze-style
	qqc2-desktop-style
	"
makedepends="
	breeze-dev
	extra-cmake-modules
	kconfig-dev
	kconfigwidgets-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knotifications-dev
	kstatusnotifieritem-dev
	kwayland-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	libxcursor-dev
	plasma-wayland-protocols
	qt6-qtbase-dev
	samurai
	"
checkdepends="xvfb-run"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-integration.git"
source="https://download.kde.org/stable/plasma/$pkgver/plasma-integration-$pkgver.tar.xz"

build() {
	cmake -B build -DBUILD_QT5=OFF -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_DISABLE_FIND_PACKAGE_FontNotoSans=true \
		-DCMAKE_DISABLE_FIND_PACKAGE_FontHack=true
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure -E "(qmltests6|frameworkintegration-k(deplatformtheme|fontsettingsdata|filedialog|hintssettings|filedialogqml)_unittest6)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
80bd8d44ceb920109d971027f71eafbdc682972d7b0eb737504c840befd47ccd6dc1536e67e173d1df11b38bb91bd493351159de853fdd2b5035800846004833  plasma-integration-6.0.4.tar.xz
"
